<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use App\Models\Setting;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
        
        // // 视图Composer
        // view()->composer('web.*', function ($view) {
        //     $header = [];
        //     $data=Setting::get();
        //     foreach($data as $v){
        //         $header[$v->key]=$v->value;
        //     }
            
        //     $view->with('header', $header);
        //     // $view->with('footer', $footer);
        // });
        // view()->composer('mobile.*', function ($view) {
        //     $header = [];
        //     $data=Setting::get();
        //     foreach($data as $v){
        //         $header[$v->key]=$v->value;
        //     }
            
        //     $view->with('header', $header);
        //     // $view->with('footer', $footer);
        // });
        
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
